package bean.service.impl;

import bean.dao.impl.UserDaoImpl;
import bean.domain.User;
import bean.service.IUserService;
import java.util.List;

public class UserServiceImpl implements IUserService {

    public UserServiceImpl() {
        System.out.println("UserServiceImpl 已创建成功");
    }

    UserDaoImpl userDao = new UserDaoImpl();

    Integer num = 0;

    public List<User> selectAll() {
        System.out.println("UserServiceImpl select all");

        return userDao.selectAll();
    }

    public Integer addUserDao(Integer addNum) {
        return userDao.getIbyAdd(addNum);
    }

    @Override
    public Integer getIbyAdd(Integer addNum) {
        return num+=addNum;
    }

    public Integer getIbyAdd2(Integer addNum) {
        num=0;
        return num+=addNum;
    }
}
